package com.energyfuture.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.energyfuture.common.core.constant.UserConstants;
import com.energyfuture.system.api.domain.SysCompany;
import com.energyfuture.system.mapper.*;
import com.energyfuture.system.service.ISysCompanyService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

/**
 * 单位 业务层处理
 * 
 * @author lxt
 */
@Service
public class SysCompanyServiceImpl implements ISysCompanyService
{
    private static final Logger log = LoggerFactory.getLogger(SysCompanyServiceImpl.class);
    @Resource
    private SysCompanyMapper sysCompanyMapper;

    @Override
    public boolean save(SysCompany entity) {
       int result= sysCompanyMapper.insert(entity);
        if (result != 0) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public boolean saveBatch(Collection<SysCompany> collection) {
        return false;
    }

    @Override
    public boolean saveBatch(Collection<SysCompany> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection<SysCompany> collection) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection<SysCompany> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean removeById(Serializable id) {
        return false;
    }

    @Override
    public boolean removeByMap(Map<String, Object> columnMap) {
        return false;
    }

    @Override
    public boolean remove(Wrapper<SysCompany> queryWrapper) {
        return false;
    }

    @Override
    public boolean removeByIds(Collection<? extends Serializable> idList) {
        return false;
    }

    @Override
    public boolean updateById(SysCompany entity) {
        int result = sysCompanyMapper.updateById(entity);
        if (result != 0) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public boolean update(SysCompany entity, Wrapper<SysCompany> updateWrapper) {
        return false;
    }

    @Override
    public boolean updateBatchById(Collection<SysCompany> collection) {
        return false;
    }

    @Override
    public boolean updateBatchById(Collection<SysCompany> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdate(SysCompany entity) {
        return false;
    }

    @Override
    public SysCompany getById(Serializable id) {
        return null;
    }

    @Override
    public Collection<SysCompany> listByIds(Collection<? extends Serializable> idList) {
        return null;
    }

    @Override
    public Collection<SysCompany> listByMap(Map<String, Object> columnMap) {
        return null;
    }

    @Override
    public SysCompany getOne(Wrapper<SysCompany> wrapper) {
        return null;
    }

    @Override
    public SysCompany getOne(Wrapper<SysCompany> queryWrapper, boolean throwEx) {
        return null;
    }


    @Override
    public Map<String, Object> getMap(Wrapper<SysCompany> queryWrapper) {
        return null;
    }

    @Override
    public <V> V getObj(Wrapper<SysCompany> queryWrapper, Function<? super Object, V> mapper) {
        return null;
    }




    @Override
    public int count(Wrapper<SysCompany> queryWrapper) {
        return 0;
    }

    @Override
    public List<SysCompany> list(Wrapper<SysCompany> queryWrapper) {
        return sysCompanyMapper.selectList(queryWrapper);
    }

    @Override
    public IPage<SysCompany> page(IPage<SysCompany> page, Wrapper<SysCompany> queryWrapper) {
        return null;
    }

    @Override
    public List<Map<String, Object>> listMaps(Wrapper<SysCompany> queryWrapper) {
        return null;
    }

    @Override
    public List<Object> listObjs(Wrapper<SysCompany> wrapper) {
        return null;
    }

    @Override
    public <V> List<V> listObjs(Wrapper<SysCompany> queryWrapper, Function<? super Object, V> mapper) {
        return null;
    }


    @Override
    public IPage<Map<String, Object>> pageMaps(IPage<SysCompany> page, Wrapper<SysCompany> queryWrapper) {
        return null;
    }

    @Override
    public BaseMapper<SysCompany> getBaseMapper() {
        return null;
    }


    @Override
    public List<SysCompany> selectList(SysCompany sysCompany) {
        return sysCompanyMapper.selectList(sysCompany);
    }

    @Override
    public String checkCompanyNameUnique(String sysCompanyName) {
        int count = sysCompanyMapper.checkCompanyNameUnique(sysCompanyName);
        if (count > 0)
        {
            return UserConstants.NOT_UNIQUE;
        }
        return UserConstants.UNIQUE;
    }
}
